<?php
//节点模块
class StatisticsAction extends CommonAction {
	public function _filter(&$map)
	{
	}
	
	public function index() {
		//$model	=	M();
		
		$this->assign('flash_chart',$this->show_flash_chart());
		$this->display ();
	}
	
	public function show_flash_chart($pr='chart_data'){
    	import('ORG.Util.OFClibrary.open_flash_chart_object');
    	$theme='http://'.$_SERVER['HTTP_HOST'].C('ADMIN_THEME').'/ofc_theme/';
    	return open_flash_chart_object( '100%', 350, '__URL__/'.$pr, true ,$theme);
    }
    

    public function chart_data(){
    	srand((double)microtime()*1000000);
    	$data_1 = array();
    	$data_2 = array();
    	for( $i=0; $i<13; $i++ )
    	{
    		$data_1[] = rand(11,19);
    		$data_2[] = rand(1,10);
    	}
    	import('ORG.Util.OFClibrary.open-flash-chart');
    	$g = new graph();

    	// line 1:
    	$g->set_data( $data_1 );
    	// 3 pixels wide line, with a 6 pixel dot (and tooltip)
    	$g->line_dot( 3, 6, '#9933CC', '成功率', 18 );

    	// line 2:
    	$g->set_data( $data_2 );
    	// 2 pixel line, no dot
    	$g->line_dot( 2,6, '#50CC33', '失败率', 18 );

    	$g->set_x_labels( $data_2 );
    	$g->set_y_max( 20 );
    	$g->title( 'XX通道成功率/失败率 分析图', '{font-size: 25px; color: #FF8040}' );
    	echo $g->render();
    }
public function chart_data2(){
    	srand((double)microtime()*1000000);
    	//$data_1 = array();
    	$data_2 = array();
    	for( $i=0; $i<13; $i++ )
    	{
    	//	$data_1[] = rand(11,19);
    		$data_2[] = rand(1,10);
    	}
    	import('ORG.Util.OFClibrary.open-flash-chart');
    	$g = new graph();

    	// line 1:
    	//$g->set_data( $data_1 );
    	// 3 pixels wide line, with a 6 pixel dot (and tooltip)
    	//$g->line_dot( 3, 6, '#9933CC', '成功率2', 18 );

    	// line 2:
    	$g->set_data( $data_2 );
    	// 2 pixel line, no dot
    	$g->line_dot( 2,6, '#50CC33', '失败率2', 18 );

    	$g->set_x_labels( $data_2 );
    	$g->set_y_max( 20 );
    	$g->title( 'XX通道成功率2/失败率 分析图2', '{font-size: 25px; color: #FF8040}' );
    	echo $g->render();
    }
public function chart_data3(){
    	srand((double)microtime()*1000000);
    	$data_1 = array();
    	$data_2 = array();
    	for( $i=0; $i<13; $i++ )
    	{
    		$data_1[] = rand(11,19);
    		$data_2[] = rand(1,10);
    	}
    	import('ORG.Util.OFClibrary.open-flash-chart');
    	$g = new graph();

    	// line 1:
    	$g->set_data( $data_1 );
    	// 3 pixels wide line, with a 6 pixel dot (and tooltip)
    	$g->line_dot( 3, 6, '#9933CC', '成功率3', 18 );

    	// line 2:
    	$g->set_data( $data_2 );
    	// 2 pixel line, no dot
    	$g->line_dot( 2,6, '#50CC33', '失败率3', 18 );

    	$g->set_x_labels( $data_2 );
    	$g->set_y_max( 20 );
    	$g->title( 'XX通道成功率3/失败率 分析图3', '{font-size: 25px; color: #FF8040}' );
    	echo $g->render();
    }
	
}